<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddColumnToOpenShopLocation extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_location', function (Blueprint $table) {
            $table->unsignedTinyInteger('cashType')->default(0)->comment('收银方式 1 第三方收银 2 自主收银');
            $table->unsignedInteger('openTime')->default(0)->comment('开店时间');
            $table->unsignedInteger('electricQuantity')->default(0)->comment('用电量');
            $table->unsignedTinyInteger('isAddElectricNum')->default(0)->comment('是否支持用电量增容 0 否 1 是');
            $table->unsignedInteger('smokeNumber')->default(0)->comment('排烟量');
            $table->unsignedTinyInteger('isReformSmoke')->default(0)->comment('是否支持排烟改造 0 否 1 是');
            $table->unsignedInteger('upperWaterDiameter')->default(0)->comment('上水管径');
            $table->unsignedInteger('lowerWaterDiameter')->default(0)->comment('下水管径');
            $table->unsignedInteger('isReformWater')->default(0)->comment('是否支持上下水管径改造 0 否 1 是');
            $table->string('shopLocationReportLink')->default(0)->comment('伙伴云选址报告链接')
                  ->after('shopLocationReportUrl');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_location', function (Blueprint $table) {
            $table->dropColumn('cashType');
            $table->dropColumn('openTime');
            $table->dropColumn('electricQuantity');
            $table->dropColumn('isAddElectricNum');
            $table->dropColumn('smokeNumber');
            $table->dropColumn('isReformSmoke');
            $table->dropColumn('upperWaterDiameter');
            $table->dropColumn('lowerWaterDiameter');
            $table->dropColumn('isReformWater');
            $table->dropColumn('shopLocationReportLink');
        });
    }
}
